package com.gxa.stu.common;

public enum ExceptionCode {

    // 枚举就是类型 , 枚举中的值先声明好, 直接用
    //枚举中同样可以声明字段/方法/bean方法/构造方法
    // 枚举中的值一般用全大写的英文单词组合
    WRONG_SERVER("50000", "服务器发生未知错误,请告知班主任和项目经理或稍后再试"),
    WRONG_PHONE_NUMBER("50004", "不是一个有效的手机号码"),
    WRONG_PHONE_NUMBER_OR_EXPIRED("50014","手机号输入不正确或登录已过期,请重新登录"),
    WRONG_LOGIN_STATUS("50016","该用户已经冻结"),
    WRONG_TOKEN("50018","未能正确提供token,请重新登录"),
    WRONG_CAPTCHA("50007", "验证码输入不正确或已过期,请重新登录"),
    WRONG_PERMISSION("50008", "没有操作权限或登录已过期,请重新登录"),
    WRONG_TIMESTAMP("50009", "时间格式不正确"),
    FAILED_SMS("50005", "短信发送失败,请稍后再试"),
    FAILED_LOGIN("50001", "登录失败,请检查用户名或密码是否正确"),
    FAILED_DELETE("50003", "删除失败"),
    FAILED_UPDATE("51002","修改失败"),
    FAILED_ADD("51001","添加失败"),
    DUPLICATE_USERNAME("50002", "重复的用户名"),
    DUPLICATE_PHONE("50006","该手机号已被注册"),
    NULL_TOKEN("50013","请求中缺少token，请重新登录"),
    NULL_DATA("50014","数据中有不允许为空的字段,请检查"),
    NULL_PHONE("50019","手机号不允许为空"),
    NULL_CODE("50020","验证码不允许为空"),
            ;



    // 枚举的字段可以不加访问权限, 要加必须是private
    private String code;
    private String message;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    ExceptionCode(String code, String message) {
        this.code = code;
        this.message = message;
    }
}
